#include <stdio.h>

int point_1(void)
{
	char* str = "ABCDEFGHIJKL";
    int* pInt = (int*)str;

    printf("%c\n%c\n",*(str+1),*(char *)(pInt+1));	// B	E

	printf("%c\n", *(char *)(pInt+2));	// I

    return 0;
}

void point_2()
{
	char *str = "abcdef";

	printf("%s\n", str);

	//*str = "fedcba";	// error : 单个字符赋值
	str = "fedcba";	
	printf("%s\n", str);	// fedcba

	//str[2] = 'C';		//修改第三个字符为大写		Segmentation fault
	//printf("%s\n", str);
}


static char *estimate_mode(unsigned short *pmode)
{
	char *msg = 0;

	if (*pmode == 0x00) {
		msg = "Standby";
	}
	else if (*pmode == 0x01) {
		msg = "Working";
	}
	else if (*pmode == 0x02) {
		msg = "Error";
	}

	return msg;
}


int main()
{
	short i = 0;

	point_1();
	point_2();	
	printf("%s\n", estimate_mode(&i));
	
	return 0;
}
